import axios from "axios";

export default function (value = null) {
  let params = value ? [{ key: "MISC_HOLIDAYS", value }] : ["MISC_HOLIDAYS"];
  return new Promise((resolve, reject) => {
    axios
      .post("api/global_params.php", { params })
      .then((response) => {
        if (response.data.code == 1 && response.data.content["MISC_HOLIDAYS"]) {
          resolve(response.data.content["MISC_HOLIDAYS"]);
        } else {
          resolve([]);
        }
      })
      .catch((error) => {
        reject(error);
      });
  });
}
